//
//  OMOrderRefundReasonSelectionTableCell.m
//  OMENGO_NEW
//
//  Created by 梁尚嘉 on 2017/5/16.
//  Copyright © 2017年 Kamfat. All rights reserved.
//

#import "OMOrderRefundReasonSelectionTableCell.h"
@interface OMOrderRefundReasonSelectionTableCell()
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIButton *checkBoxBtn;
@end


@implementation OMOrderRefundReasonSelectionTableCell

- (UIButton *)checkBoxBtn
{
    if (!_checkBoxBtn) {
        _checkBoxBtn = [UIButton new];
        [_checkBoxBtn setImage:[UIImage imageNamed:@"btn_shoppingcart_s"] forState:UIControlStateNormal];
        [_checkBoxBtn setImage:[UIImage imageNamed:@"address_selected_19x19_"] forState:UIControlStateSelected];
        _checkBoxBtn.userInteractionEnabled = NO;
    }
    return _checkBoxBtn;
}

- (void)configure
{
    [super configure];
    _titleLabel = [UILabel new];
    _titleLabel.textColor = SM_darkGrayColor;
    _titleLabel.font = SM_CFont(31);
    [self.contentView addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(SM_SIZE(30)));
        make.centerY.equalTo(self.contentView.mas_centerY);
    }];

    [self.contentView addSubview:self.checkBoxBtn];
    [self.checkBoxBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(@(SM_SIZE(-30)));
        make.centerY.equalTo(self.contentView.mas_centerY);
    }];
}

- (void)configureCellWithObj:(NSString *)obj
{
    _titleLabel.text = obj;
}

- (void)setOm_selected:(BOOL)om_selected
{
    _om_selected = om_selected;
    self.checkBoxBtn.selected = _om_selected;
}

@end
